export const routes = [
  {
    path: '/',
    redirect: '/home',
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('@/views/home/home.vue'),
  },
  //当前选择城市页
  {
    path: '/city/:cityid',
    component: () => import('@/views/city/city.vue'),
  },
  //所有商铺列表页
  {
    path: '/msite',
    component: () => import('@/views/msite/msite.vue'),
    meta: { keepAlive: false },
  },
  //特色商铺列表页
  {
    path: '/food',
    component: () => import('@/views/food/food.vue'),
  },
  //搜索页
  {
    name: 'search',
    path: '/search/:geohash',
    component: () => import('@/views/search/search.vue'),
  },
  //商铺详情页
  {
    path: '/shop',
    component: () => import('@/views/shop/shop.vue'),
    children: [
      {
        path: 'foodDetail', //食品详情页
        component: () => import('@/views/shop/children/foodDetail.vue'),
      },
      {
        path: 'shopDetail', //商铺详情页
        component: () => import('@/views/shop/children/shopDetail.vue'),
        children: [
          {
            path: 'shopSafe', //商铺安全认证页
            component: () => import('@/views/shop/children/children/shopSafe.vue'),
          },
        ],
      },
    ],
  },
  //确认订单页
  {
    path: '/confirmOrder',
    component: () => import('@/views/confirmOrder/confirmOrder.vue'),
    children: [
      {
        path: 'remark', //订单备注
        component: () => import('@/views/confirmOrder/children/remark.vue'),
      },
      {
        path: 'invoice', //发票抬头
        component: () => import('@/views/confirmOrder/children/invoice.vue'),
      },
      {
        path: 'payment', //付款页面
        component: () => import('@/views/confirmOrder/children/payment.vue'),
      },
      {
        path: 'userValidation', //用户验证
        component: () => import('@/views/confirmOrder/children/userValidation.vue'),
      },
      {
        path: 'chooseAddress', //选择地址
        component: () => import('@/views/confirmOrder/children/chooseAddress.vue'),
        children: [
          {
            path: 'addAddress', //添加地址
            component: () => import('@/views/confirmOrder/children/children/addAddress.vue'),
            children: [
              {
                path: 'searchAddress', //搜索地址
                component: () =>
                  import('@/views/confirmOrder/children/children/children/searchAddress.vue'),
              },
            ],
          },
        ],
      },
    ],
  },
  //登录注册页
  {
    path: '/login',
    component: () => import('@/views/login/login.vue'),
  },
  //个人信息页
  {
    path: '/profile',
    component: () => import('@/views/profile/profile.vue'),
    children: [
      {
        path: 'info', //个人信息详情页
        component: () => import('@/views/profile/children/info.vue'),
        children: [
          {
            path: 'setusername',
            component: () => import('@/views/profile/children/children/setusername.vue'),
          },
          {
            path: 'address',
            component: () => import('@/views/profile/children/children/address.vue'), //编辑地址
            children: [
              {
                path: 'add',
                component: () => import('@/views/profile/children/children/children/add.vue'),
                children: [
                  {
                    path: 'addDetail',
                    component: () =>
                      import('@/views/profile/children/children/children/children/addDetail.vue'),
                  },
                ],
              },
            ],
          },
        ],
      },
      {
        path: 'service', //服务中心
        component: () => import('@/views/service/service.vue'),
      },
    ],
  },
  //修改密码页
  {
    path: '/forget',
    component: () => import('@/views/forget/forget.vue'),
  },
  //订单列表页
  {
    path: '/order',
    component: () => import('@/views/order/order.vue'),
    children: [
      {
        path: 'orderDetail', //订单详情页
        component: () => import('@/views/order/children/orderDetail.vue'),
      },
    ],
  },
  //vip卡页
  {
    path: '/vipcard',
    component: () => import('@/views/vipcard/vipcard.vue'),
    children: [
      {
        path: 'invoiceRecord', //开发票
        component: () => import('@/views/vipcard/children/invoiceRecord.vue'),
      },
      {
        path: 'useCart', //购买会员卡
        component: () => import('@/views/vipcard/children/useCart.vue'),
      },
      {
        path: 'vipDescription', //会员说明
        component: () => import('@/views/vipcard/children/vipDescription.vue'),
      },
    ],
  },
  //发现页
  {
    path: '/find',
    component: () => import('@/views/find/find.vue'),
  },
  //下载页
  {
    path: '/download',
    component: () => import('@/views/download/download.vue'),
  },
  //服务中心
  {
    path: '/service',
    component: () => import('@/views/service/service.vue'),
    children: [
      {
        path: 'questionDetail', //订单详情页
        component: () => import('@/views/service/children/questionDetail.vue'),
      },
    ],
  },
  //余额
  {
    path: '/balance',
    component: () => import('@/views/balance/balance.vue'),
    children: [
      {
        path: 'detail', //余额说明
        component: () => import('@/views/balance/children/detail.vue'),
      },
    ],
  },
  //我的优惠页
  {
    path: '/benefit',
    component: () => import('@/views/benefit/benefit.vue'),
    children: [
      {
        path: 'coupon', //代金券说明
        component: () => import('@/views/benefit/children/coupon.vue'),
      },
      {
        path: 'hbDescription', //红包说明
        component: () => import('@/views/benefit/children/hbDescription.vue'),
      },
      {
        path: 'hbHistory', //历史红包
        component: () => import('@/views/benefit/children/hbHistory.vue'),
      },
      {
        path: 'exchange', //兑换红包
        component: () => import('@/views/benefit/children/exchange.vue'),
      },
      {
        path: 'commend', //推荐有奖
        component: () => import('@/views/benefit/children/commend.vue'),
      },
    ],
  },
  //我的积分页
  {
    path: '/points',
    component: () => import('@/views/points/points.vue'),
    children: [
      {
        path: 'detail', //积分说明
        component: () => import('@/views/points/children/detail.vue'),
      },
    ],
  },
];
